import { defineStore } from "pinia";
import { 
  getProjectList 
} from '@/service/blog/project'

interface projectState{
  projectList: any[],
  total: any
}

const useProjectStore = defineStore('project', {
  state: ():projectState => ({
    projectList: [],
    total: 0
  }),
  actions: {
    getProjectListAction() {
      getProjectList().then(res => {
        // console.log(res)
        this.projectList = res.data
        this.total = res.data.length
      })
    }
  }
})

export default useProjectStore